import requestAxios from './request.axios';
import requsetFecth from './request.fetch';

//  import { routerRedux } from 'dva/router';


/**
 * Requests a URL, returning a promise.
 *
 * @param  {string} url       The URL we want to request
 * @param  {object} [options] The options we want to pass to "fetch"
 * @return {object}           An object containing either "data" or "err"
 */
export default function request(type,url, options) {
  switch (type){
    case 'axios':
      return requestAxios(url,options);
    case 'fetch':
      return requsetFecth(url,options);
    default:
       return false;
  }
}
